package com.chen.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.List;

/**
 * @author chenchao
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("article")
@ApiModel(value = "文章",description = "")
public class Article {
    @TableId(type = IdType.AUTO)
    private Integer id;
    private String content;
    private String category;
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")//日期格式化
    private Date time;
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss", timezone = "GMT+8")//日期格式化
    private Date utime;
    private String author;
    private String img;  //背景图片

    private String title;

    @TableField(exist = false)
    private String avatar;  //头像
    @TableField(exist = false)
    private String nick;  //头像

    @TableField(exist = false)
    List<Article> categorys;

    private String tag;

    @TableField(exist = false)
    private int count;

    @ApiModelProperty("点赞数")
    private int counts;

    @TableField(exist = false)
    private int articleCount;

    @ApiModelProperty("判断是否公开")
    private Boolean flag;

    @TableField(exist = false)
    private int seeCount;   //浏览量

    @TableField(value="isEnable")
    private Boolean isEnable; //文章状态

    @TableField(exist = false)
    private int articleCounts;

}
